package com.example.jl.bethinner.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.example.jl.bethinner.R;

/**
 * Created by JL on 6/5/15.
 */
public class DraggableGridViewAdapter extends BaseAdapter {
    private Context context;
    private int sise;


    public DraggableGridViewAdapter(Context context, int sise) {
        this.context = context;
        this.sise = sise;
    }

    @Override
    public int getCount() {
        return sise;
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder viewHolder = new ViewHolder();
        if (null == convertView) {
            convertView = LayoutInflater.from(context).inflate(R.layout.item_room_recycler, null);
            viewHolder.textView = (TextView) convertView.findViewById(R.id.room_name);
            convertView.setTag(viewHolder);
        } else {
            viewHolder = (ViewHolder) convertView.getTag();
        }
        viewHolder.textView.setText("客厅" + position);
        return convertView;
    }

    private final class ViewHolder {
        private TextView textView;
    }
}
